package main

import "fmt"

func main() {

	// map的排序
	map1 := make(map[int]int, 10)
	map1[10] = 100
	map1[1] = 13
	map1[4] = 56
	map1[8] = 90

	var key []int
	for k, _ := range map1 {

		key = append(key, k)

	}

	for i := 0 ; i < len(key) - 1; i++ {

		for j := 0; j < len(key) - i - 1; j++ {

			if key[j] > key[j+1] {

				tmp := key[j]
				key[j] = key[j+1]
				key[j+1] = tmp

			}


		}


	}



	fmt.Println("map1:", map1)
	fmt.Println("key:", key)

	for _, v := range key {

		fmt.Printf("map1[\"%v\"]=%v\n", v, map1[v])

	}


}